package com.xnyzc.lhy.finance.service.fegin.invoice.fallback;

import com.xnyzc.lhy.common.penum.invoice.EInvoiceErrorCode;
import com.xnyzc.lhy.finance.service.fegin.invoice.IInvoiceService;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceAaOpenParam;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceAaOpenResult;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceAaQueryOrCancellationParam;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceFormatFileParam;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceFormatFileResult;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceInvalidParam;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceOpenResult;
import com.xnyzc.lhy.resource.entity.invoice.InvoiceParam;
import com.xnyzc.lhy.resource.entity.invoice.ReInvoiceInvalidResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 电子发票服务
 * </p>
 *
 * @author haoyfa
 * @since 2019-10-24
 */
@Slf4j
@Service
public class InvoiceServiceImpl implements IInvoiceService {
    /**
     * 发票开具服务调用失败
     */
    @Override
    public InvoiceOpenResult invoiceOpenRequest(InvoiceParam invoiceParam) {
        return InvoiceOpenResult.getInvoiceErrorResponse(EInvoiceErrorCode.outerServiceError);
    }

    /**
     * 板式文件生成
     */
    @Override
    public InvoiceFormatFileResult formatfileBuildRequest(InvoiceFormatFileParam invoiceFormatFileParam) {
        return InvoiceFormatFileResult.getInvoiceErrorResponse(EInvoiceErrorCode.outerServiceError);
    }

    /**
     * 发票作废
     *
     * @param invoiceInvalidParam
     * @return
     */
    @Override
    public ReInvoiceInvalidResult invoiceInvalidRequest(InvoiceInvalidParam invoiceInvalidParam) {
        return ReInvoiceInvalidResult.getInvoiceErrorResponse(EInvoiceErrorCode.outerServiceError);
    }

    /**
     * AA发票开票失败
     *
     * @param invoiceAaOpenParam
     * @return
     */
    @Override
    public InvoiceAaOpenResult invoiceAaOpenRequest(InvoiceAaOpenParam invoiceAaOpenParam) {
        InvoiceAaOpenResult invoiceAaOpenResult = new InvoiceAaOpenResult();
        invoiceAaOpenResult.setCode(1);
        invoiceAaOpenResult.setMessage(EInvoiceErrorCode.outerServiceError.getDesc());
        return invoiceAaOpenResult;
    }

    @Override
    public InvoiceAaOpenResult getInvoiceAaQuery(InvoiceAaQueryOrCancellationParam invoiceAaQueryOrCancellationParam) {
        InvoiceAaOpenResult invoiceAaOpenResult = new InvoiceAaOpenResult();
        invoiceAaOpenResult.setCode(1);
        invoiceAaOpenResult.setMessage(EInvoiceErrorCode.outerServiceError.getDesc());
        return invoiceAaOpenResult;
    }

    @Override
    public InvoiceAaOpenResult invoiceAaCancellation(InvoiceAaQueryOrCancellationParam invoiceAaQueryOrCancellationParam) {
        InvoiceAaOpenResult invoiceAaOpenResult = new InvoiceAaOpenResult();
        invoiceAaOpenResult.setCode(1);
        invoiceAaOpenResult.setMessage(EInvoiceErrorCode.outerServiceError.getDesc());
        return invoiceAaOpenResult;
    }


}
